<extend name="Public/base"/>

<block name="body">
    <!-- 标题栏 -->
    <div class="main-title">
        <h2>{$title}</h2>
    </div>
    <!-- 按钮工具栏 -->
    <div class="cf">
        <h3>至尊洗衣液</h3>
        <p class="check-tips" style="color: red">注：每次计算只会随机展示选中的其中一种产品。</p>
        <p class="check-tips" style="color: red">当配置了该优先项后，默认将不再生效，请务必保证至尊和普通洗衣液都配置完整，且设置洗涤必备优先为开启状态。</p>
        <a class="btn fr fh_dis"  href="{:U('func_menu')}" style="margin: 0px">返回上一级</a>
        <a class="btn fr fh_dis" href="{:U('three_func_pre_first_edit?meta_title='.$title.'-至尊洗衣液-编辑&order=0&id='.$pre['id'])}">编 辑</a>
    </div>
    <!-- 数据列表 -->
    <div class="data">
        <table class="">
            <thead>
            <tr>
                <th class="public_tanle_qianmian">产品图片</th>
                <th class="public_tanle_qianmian">产品名称</th>
                <th class="public_tanle_qianmian">标签</th>
            </tr>
            </thead>
            <tbody>
            <notempty name="zz">
                <volist name="zz" id="zz_vo">
                    <tr>
                        <td class="public_content_qianmian" width="120px"><img src="{$zz_vo.product_url}" style="height: auto;" /></td>
                        <td class="public_content_qianmian">{$zz_vo.product_name|default='--'}</td>
                        <td class="public_content_qianmian" width="180px">{$zz_vo.label|default='--'}</td>
                    </tr>
                </volist>
                <else/>
                <td colspan="100" class="text-center"> 暂时没有优先项 </td>
            </notempty>
            </tbody>
        </table>
    </div>

    <!-- 按钮工具栏 -->
    <div class="cf" style="padding-top: 70px">
        <h3>普通洗衣液</h3>
        <p class="check-tips" style="color: red">注：每次计算只会随机展示选中的其中一种产品。</p>
        <p class="check-tips" style="color: red">当配置了该优先项后，默认将不再生效，请务必保证至尊和普通洗衣液都配置完整，且设置洗涤必备优先为开启状态。</p>
        <a class="btn fr fh_dis"  href="{:U('func_menu')}" style="margin: 0px">返回上一级</a>
        <a class="btn fr fh_dis" href="{:U('three_func_pre_first_edit?meta_title='.$title.'-普通洗衣液-编辑&order=1&id='.$pre['id'])}">编 辑</a>
    </div>
    <!-- 数据列表 -->
    <div class="data">
        <table class="">
            <thead>
            <tr>
                <th class="public_tanle_qianmian">产品图片</th>
                <th class="public_tanle_qianmian">产品名称</th>
                <th class="public_tanle_qianmian">标签</th>
            </tr>
            </thead>
            <tbody>
            <notempty name="pt">
                <volist name="pt" id="pt_vo">
                    <tr>
                        <td class="public_content_qianmian" width="120px"><img src="{$pt_vo.product_url}" style="height: auto;" /></td>
                        <td class="public_content_qianmian">{$pt_vo.product_name|default='--'}</td>
                        <td class="public_content_qianmian" width="180px">{$pt_vo.label|default='--'}</td>
                    </tr>
                </volist>
                <else/>
                <td colspan="100" class="text-center"> 暂时没有优先项 </td>
            </notempty>
            </tbody>
        </table>
    </div>
</block>

<block name="script">
    <link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
    <php>if(C('COLOR_STYLE')=='blue_color') echo '<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">';</php>
    <link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
    <script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
    <!-- 引入CSS、JS开始 -->
    <link href="__CSS__/wash_helper/gm_table_public.css" rel="stylesheet" type="text/css">
    <!-- 引入CSS、JS结束 -->
    <script type="text/javascript">
        /* 当前子菜单栏高亮 */
        highlight_subnav('{:U('Calculation/func_menu')}');

        $(function () {
            /* 无刷新禁用 */
            $('.del').click(function(){
                var target;
                var that = this;

                if(!confirm('删除将不可恢复，确认删除吗？')){
                    return false;
                }

                target = $(this).attr('href');
                $.get(target).success(function(data){
                    if (data.status==1) {
                        if (data.url) {
                            updateAlert(data.info + ' 页面即将自动跳转~','alert-success');
                        }else{
                            updateAlert(data.info,'alert-success');
                        }
                        setTimeout(function(){
                            if (data.url) {
                                location.href=data.url;
                            }else if( $(that).hasClass('no-refresh')){
                                $('#top-alert').find('button').click();
                            }else{
                                location.reload();
                            }
                        },1500);
                    }else{
                        updateAlert(data.info);
                        setTimeout(function(){
                            if (data.url) {
                                location.href=data.url;
                            }else{
                                $('#top-alert').find('button').click();
                            }
                        },1500);
                    }
                });
                return false;
            });
        })
    </script>
</block>